{
    "description": "A financial research agent that takes in a query, plan the steps, search the web, and return a detailed report",
    "usecases": ["Finance & Accounting"],
    "nodes": [
        {
            "id": "startAgentflow_0",
            "type": "agentFlow",
            "position": {
                "x": -234.94624728418063,
                "y": 84.92919739582129
            },
            "data": {
                "id": "startAgentflow_0",
                "label": "Start",
                "version": 1.1,
                "name": "startAgentflow",
                "type": "Start",
                "color": "#7EE787",
                "hideInput": true,
                "baseClasses": ["Start"],
                "category": "Agent Flows",
                "description": "Starting point of the agentflow",
                "inputParams": [
                    {
                        "label": "Input Type",
                        "name": "startInputType",
                        "type": "options",
                        "options": [
                            {
                                "label": "Chat Input",
                                "name": "chatInput",
                                "description": "Start the conversation with chat input"
                            },
                            {
                                "label": "Form Input",
                                "name": "formInput",
                                "description": "Start the workflow with form inputs"
                            }
                        ],
                        "default": "chatInput",
                        "id": "startAgentflow_0-input-startInputType-options",
                        "display": true
                    },
                    {
                        "label": "Form Title",
                        "name": "formTitle",
                        "type": "string",
                        "placeholder": "Please Fill Out The Form",
                        "show": {
                            "startInputType": "formInput"
                        },
                        "id": "startAgentflow_0-input-formTitle-string",
                        "display": true
                    },
                    {
                        "label": "Form Description",
                        "name": "formDescription",
                        "type": "string",
                        "placeholder": "Complete all fields below to continue",
                        "show": {
                            "startInputType": "formInput"
                        },
                        "id": "startAgentflow_0-input-formDescription-string",
                        "display": true
                    },
                    {
                        "label": "Form Input Types",
                        "name": "formInputTypes",
                        "description": "Specify the type of form input",
                        "type": "array",
                        "show": {
                            "startInputType": "formInput"
                        },
                        "array": [
                            {
                                "label": "Type",
                                "name": "type",
                                "type": "options",
                                "options": [
                                    {
                                        "label": "String",
                                        "name": "string"
                                    },
                                    {
                                        "label": "Number",
                                        "name": "number"
                                    },
                                    {
                                        "label": "Boolean",
                                        "name": "boolean"
                                    },
                                    {
                                        "label": "Options",
                                        "name": "options"
                                    }
                                ],
                                "default": "string"
                            },
                            {
                                "label": "Label",
                                "name": "label",
                                "type": "string",
                                "placeholder": "Label for the input"
                            },
                            {
                                "label": "Variable Name",
                                "name": "name",
                                "type": "string",
                                "placeholder": "Variable name for the input (must be camel case)",
                                "description": "Variable name must be camel case. For example: firstName, lastName, etc."
                            },
                            {
                                "label": "Add Options",
                                "name": "addOptions",
                                "type": "array",
                                "show": {
                                    "formInputTypes[$index].type": "options"
                                },
                                "array": [
                                    {
                                        "label": "Option",
                                        "name": "option",
                                        "type": "string"
                                    }
                                ]
                            }
                        ],
                        "id": "startAgentflow_0-input-formInputTypes-array",
                        "display": true
                    },
                    {
                        "label": "Ephemeral Memory",
                        "name": "startEphemeralMemory",
                        "type": "boolean",
                        "description": "Start fresh for every execution without past chat history",
                        "optional": true
                    },
                    {
                        "label": "Flow State",
                        "name": "startState",
                        "description": "Runtime state during the execution of the workflow",
                        "type": "array",
                        "optional": true,
                        "array": [
                            {
                                "label": "Key",
                                "name": "key",
                                "type": "string",
                                "placeholder": "Foo"
                            },
                            {
                                "label": "Value",
                                "name": "value",
                                "type": "string",
                                "placeholder": "Bar"
                            }
                        ],
                        "id": "startAgentflow_0-input-startState-array",
                        "display": true
                    },
                    {
                        "label": "Persist State",
                        "name": "startPersistState",
                        "type": "boolean",
                        "description": "Persist the state in the same session",
                        "optional": true,
                        "id": "startAgentflow_0-input-startPersistState-boolean",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "startInputType": "formInput",
                    "formTitle": "Finanical Research",
                    "formDescription": "A financial research agent that takes in a query, and return a detailed report",
                    "formInputTypes": [
                        {
                            "type": "string",
                            "label": "Query",
                            "name": "query",
                            "addOptions": ""
                        }
                    ],
                    "startState": [
                        {
                            "key": "search_key_reason",
                            "value": ""
                        }
                    ]
                },
                "outputAnchors": [
                    {
                        "id": "startAgentflow_0-output-startAgentflow",
                        "label": "Start",
                        "name": "startAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "width": 101,
            "height": 65,
            "selected": false,
            "positionAbsolute": {
                "x": -234.94624728418063,
                "y": 84.92919739582129
            },
            "dragging": false
        },
        {
            "id": "llmAgentflow_0",
            "position": {
                "x": -92.42002168895628,
                "y": 81.69973969492588
            },
            "data": {
                "id": "llmAgentflow_0",
                "label": "Planner",
                "version": 1,
                "name": "llmAgentflow",
                "type": "LLM",
                "color": "#64B5F6",
                "baseClasses": ["LLM"],
                "category": "Agent Flows",
                "description": "Large language models to analyze user-provided inputs and generate responses",
                "inputParams": [
                    {
                        "label": "Model",
                        "name": "llmModel",
                        "type": "asyncOptions",
                        "loadMethod": "listModels",
                        "loadConfig": true,
                        "id": "llmAgentflow_0-input-llmModel-asyncOptions",
                        "display": true
                    },
                    {
                        "label": "Messages",
                        "name": "llmMessages",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Role",
                                "name": "role",
                                "type": "options",
                                "options": [
                                    {
                                        "label": "System",
                                        "name": "system"
                                    },
                                    {
                                        "label": "Assistant",
                                        "name": "assistant"
                                    },
                                    {
                                        "label": "Developer",
                                        "name": "developer"
                                    },
                                    {
                                        "label": "User",
                                        "name": "user"
                                    }
                                ]
                            },
                            {
                                "label": "Content",
                                "name": "content",
                                "type": "string",
                                "acceptVariable": true,
                                "generateInstruction": true,
                                "rows": 4
                            }
                        ],
                        "id": "llmAgentflow_0-input-llmMessages-array",
                        "display": true
                    },
                    {
                        "label": "Enable Memory",
                        "name": "llmEnableMemory",
                        "type": "boolean",
                        "description": "Enable memory for the conversation thread",
                        "default": true,
                        "optional": true,
                        "id": "llmAgentflow_0-input-llmEnableMemory-boolean",
                        "display": true
                    },
                    {
                        "label": "Memory Type",
                        "name": "llmMemoryType",
                        "type": "options",
                        "options": [
                            {
                                "label": "All Messages",
                                "name": "allMessages",
                                "description": "Retrieve all messages from the conversation"
                            },
                            {
                                "label": "Window Size",
                                "name": "windowSize",
                                "description": "Uses a fixed window size to surface the last N messages"
                            },
                            {
                                "label": "Conversation Summary",
                                "name": "conversationSummary",
                                "description": "Summarizes the whole conversation"
                            },
                            {
                                "label": "Conversation Summary Buffer",
                                "name": "conversationSummaryBuffer",
                                "description": "Summarize conversations once token limit is reached. Default to 2000"
                            }
                        ],
                        "optional": true,
                        "default": "allMessages",
                        "show": {
                            "llmEnableMemory": true
                        },
                        "id": "llmAgentflow_0-input-llmMemoryType-options",
                        "display": true
                    },
                    {
                        "label": "Window Size",
                        "name": "llmMemoryWindowSize",
                        "type": "number",
                        "default": "20",
                        "description": "Uses a fixed window size to surface the last N messages",
                        "show": {
                            "llmMemoryType": "windowSize"
                        },
                        "id": "llmAgentflow_0-input-llmMemoryWindowSize-number",
                        "display": false
                    },
                    {
                        "label": "Max Token Limit",
                        "name": "llmMemoryMaxTokenLimit",
                        "type": "number",
                        "default": "2000",
                        "description": "Summarize conversations once token limit is reached. Default to 2000",
                        "show": {
                            "llmMemoryType": "conversationSummaryBuffer"
                        },
                        "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number",
                        "display": false
                    },
                    {
                        "label": "Input Message",
                        "name": "llmUserMessage",
                        "type": "string",
                        "description": "Add an input message as user message at the end of the conversation",
                        "rows": 4,
                        "optional": true,
                        "acceptVariable": true,
                        "show": {
                            "llmEnableMemory": true
                        },
                        "id": "llmAgentflow_0-input-llmUserMessage-string",
                        "display": true
                    },
                    {
                        "label": "Return Response As",
                        "name": "llmReturnResponseAs",
                        "type": "options",
                        "options": [
                            {
                                "label": "User Message",
                                "name": "userMessage"
                            },
                            {
                                "label": "Assistant Message",
                                "name": "assistantMessage"
                            }
                        ],
                        "default": "userMessage",
                        "id": "llmAgentflow_0-input-llmReturnResponseAs-options",
                        "display": true
                    },
                    {
                        "label": "JSON Structured Output",
                        "name": "llmStructuredOutput",
                        "description": "Instruct the LLM to give output in a JSON structured schema",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Key",
                                "name": "key",
                                "type": "string"
                            },
                            {
                                "label": "Type",
                                "name": "type",
                                "type": "options",
                                "options": [
                                    {
                                        "label": "String",
                                        "name": "string"
                                    },
                                    {
                                        "label": "String Array",
                                        "name": "stringArray"
                                    },
                                    {
                                        "label": "Number",
                                        "name": "number"
                                    },
                                    {
                                        "label": "Boolean",
                                        "name": "boolean"
                                    },
                                    {
                                        "label": "Enum",
                                        "name": "enum"
                                    },
                                    {
                                        "label": "JSON Array",
                                        "name": "jsonArray"
                                    }
                                ]
                            },
                            {
                                "label": "Enum Values",
                                "name": "enumValues",
                                "type": "string",
                                "placeholder": "value1, value2, value3",
                                "description": "Enum values. Separated by comma",
                                "optional": true,
                                "show": {
                                    "llmStructuredOutput[$index].type": "enum"
                                }
                            },
                            {
                                "label": "JSON Schema",
                                "name": "jsonSchema",
                                "type": "code",
                                "placeholder": "{\n    \"answer\": {\n        \"type\": \"string\",\n        \"description\": \"Value of the answer\"\n    },\n    \"reason\": {\n        \"type\": \"string\",\n        \"description\": \"Reason for the answer\"\n    },\n    \"optional\": {\n        \"type\": \"boolean\"\n    },\n    \"count\": {\n        \"type\": \"number\"\n    },\n    \"children\": {\n        \"type\": \"array\",\n        \"items\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"value\": {\n                    \"type\": \"string\",\n                    \"description\": \"Value of the children's answer\"\n                }\n            }\n        }\n    }\n}",
                                "description": "JSON schema for the structured output",
                                "optional": true,
                                "show": {
                                    "llmStructuredOutput[$index].type": "jsonArray"
                                }
                            },
                            {
                                "label": "Description",
                                "name": "description",
                                "type": "string",
                                "placeholder": "Description of the key"
                            }
                        ],
                        "id": "llmAgentflow_0-input-llmStructuredOutput-array",
                        "display": true
                    },
                    {
                        "label": "Update Flow State",
                        "name": "llmUpdateState",
                        "description": "Update runtime state during the execution of the workflow",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Key",
                                "name": "key",
                                "type": "asyncOptions",
                                "loadMethod": "listRuntimeStateKeys",
                                "freeSolo": true
                            },
                            {
                                "label": "Value",
                                "name": "value",
                                "type": "string",
                                "acceptVariable": true,
                                "acceptNodeOutputAsVariable": true
                            }
                        ],
                        "id": "llmAgentflow_0-input-llmUpdateState-array",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "llmModel": "chatOpenAI",
                    "llmMessages": [
                        {
                            "role": "system",
                            "content": "<p>You are a financial research planner. Given a request for financial analysis, produce a set of web searches to gather the context needed. Aim for recent headlines, earnings calls or 10‑K snippets, analyst commentary, and industry background. Output between 1 and 2 search terms to query for.</p>"
                        },
                        {
                            "role": "user",
                            "content": "<p>Query:</p><p><span class=\"variable\" data-type=\"mention\" data-id=\"$form.query\" data-label=\"$form.query\">{{ $form.query }}</span></p>"
                        }
                    ],
                    "llmEnableMemory": true,
                    "llmReturnResponseAs": "userMessage",
                    "llmStructuredOutput": [
                        {
                            "key": "searches",
                            "type": "jsonArray",
                            "enumValues": "",
                            "jsonSchema": "{\n  \"query\": {\n    \"type\": \"string\",\n    \"description\": \"The search term to feed into a web (or file) search.\"\n  },\n  \"reason\": {\n    \"type\": \"string\",\n    \"description\": \"Your reasoning for why this search is relevant.\"\n  }\n}",
                            "description": "A list of searches to perform"
                        }
                    ],
                    "llmUpdateState": [
                        {
                            "key": "search_key_reason",
                            "value": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"output.searches\" data-label=\"output.searches\">{{ output.searches }}</span> </p>"
                        }
                    ],
                    "llmModelConfig": {
                        "cache": "",
                        "modelName": "gpt-4o-mini",
                        "temperature": 0.9,
                        "streaming": true,
                        "maxTokens": "",
                        "topP": "",
                        "frequencyPenalty": "",
                        "presencePenalty": "",
                        "timeout": "",
                        "strictToolCalling": "",
                        "stopSequence": "",
                        "basepath": "",
                        "proxyUrl": "",
                        "baseOptions": "",
                        "allowImageUploads": "",
                        "imageResolution": "low",
                        "reasoningEffort": "medium",
                        "llmModel": "chatOpenAI"
                    },
                    "llmUserMessage": "<p></p>"
                },
                "outputAnchors": [
                    {
                        "id": "llmAgentflow_0-output-llmAgentflow",
                        "label": "LLM",
                        "name": "llmAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "agentFlow",
            "width": 168,
            "height": 71,
            "selected": false,
            "positionAbsolute": {
                "x": -92.42002168895628,
                "y": 81.69973969492588
            },
            "dragging": false
        },
        {
            "id": "iterationAgentflow_0",
            "position": {
                "x": 122.70987564816664,
                "y": -7.337791594648152
            },
            "data": {
                "id": "iterationAgentflow_0",
                "label": "Iteration 0",
                "version": 1,
                "name": "iterationAgentflow",
                "type": "Iteration",
                "color": "#9C89B8",
                "baseClasses": ["Iteration"],
                "category": "Agent Flows",
                "description": "Execute the nodes within the iteration block through N iterations",
                "inputParams": [
                    {
                        "label": "Array Input",
                        "name": "iterationInput",
                        "type": "string",
                        "description": "The input array to iterate over",
                        "acceptVariable": true,
                        "rows": 4,
                        "id": "iterationAgentflow_0-input-iterationInput-string",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "iterationInput": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"$flow.state.search_key_reason\" data-label=\"$flow.state.search_key_reason\">{{ $flow.state.search_key_reason }}</span> </p>"
                },
                "outputAnchors": [
                    {
                        "id": "iterationAgentflow_0-output-iterationAgentflow",
                        "label": "Iteration",
                        "name": "iterationAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "iteration",
            "width": 300,
            "height": 250,
            "selected": false,
            "positionAbsolute": {
                "x": 122.70987564816664,
                "y": -7.337791594648152
            },
            "dragging": false
        },
        {
            "id": "agentAgentflow_0",
            "position": {
                "x": 67.5,
                "y": 80.5
            },
            "data": {
                "id": "agentAgentflow_0",
                "label": "Search Agent",
                "version": 1,
                "name": "agentAgentflow",
                "type": "Agent",
                "color": "#4DD0E1",
                "baseClasses": ["Agent"],
                "category": "Agent Flows",
                "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning",
                "inputParams": [
                    {
                        "label": "Model",
                        "name": "agentModel",
                        "type": "asyncOptions",
                        "loadMethod": "listModels",
                        "loadConfig": true,
                        "id": "agentAgentflow_0-input-agentModel-asyncOptions",
                        "display": true
                    },
                    {
                        "label": "Messages",
                        "name": "agentMessages",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Role",
                                "name": "role",
                                "type": "options",
                                "options": [
                                    {
                                        "label": "System",
                                        "name": "system"
                                    },
                                    {
                                        "label": "Assistant",
                                        "name": "assistant"
                                    },
                                    {
                                        "label": "Developer",
                                        "name": "developer"
                                    },
                                    {
                                        "label": "User",
                                        "name": "user"
                                    }
                                ]
                            },
                            {
                                "label": "Content",
                                "name": "content",
                                "type": "string",
                                "acceptVariable": true,
                                "generateInstruction": true,
                                "rows": 4
                            }
                        ],
                        "id": "agentAgentflow_0-input-agentMessages-array",
                        "display": true
                    },
                    {
                        "label": "Tools",
                        "name": "agentTools",
                        "type": "array",
                        "optional": true,
                        "array": [
                            {
                                "label": "Tool",
                                "name": "agentSelectedTool",
                                "type": "asyncOptions",
                                "loadMethod": "listTools",
                                "loadConfig": true
                            },
                            {
                                "label": "Require Human Input",
                                "name": "agentSelectedToolRequiresHumanInput",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "id": "agentAgentflow_0-input-agentTools-array",
                        "display": true
                    },
                    {
                        "label": "Knowledge (Document Stores)",
                        "name": "agentKnowledgeDocumentStores",
                        "type": "array",
                        "description": "Give your agent context about different document sources. Document stores must be upserted in advance.",
                        "array": [
                            {
                                "label": "Document Store",
                                "name": "documentStore",
                                "type": "asyncOptions",
                                "loadMethod": "listStores"
                            },
                            {
                                "label": "Describe Knowledge",
                                "name": "docStoreDescription",
                                "type": "string",
                                "generateDocStoreDescription": true,
                                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                                "rows": 4
                            },
                            {
                                "label": "Return Source Documents",
                                "name": "returnSourceDocuments",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "optional": true,
                        "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array",
                        "display": true
                    },
                    {
                        "label": "Knowledge (Vector Embeddings)",
                        "name": "agentKnowledgeVSEmbeddings",
                        "type": "array",
                        "description": "Give your agent context about different document sources from existing vector stores and embeddings",
                        "array": [
                            {
                                "label": "Vector Store",
                                "name": "vectorStore",
                                "type": "asyncOptions",
                                "loadMethod": "listVectorStores",
                                "loadConfig": true
                            },
                            {
                                "label": "Embedding Model",
                                "name": "embeddingModel",
                                "type": "asyncOptions",
                                "loadMethod": "listEmbeddings",
                                "loadConfig": true
                            },
                            {
                                "label": "Knowledge Name",
                                "name": "knowledgeName",
                                "type": "string",
                                "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information"
                            },
                            {
                                "label": "Describe Knowledge",
                                "name": "knowledgeDescription",
                                "type": "string",
                                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                                "rows": 4
                            },
                            {
                                "label": "Return Source Documents",
                                "name": "returnSourceDocuments",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "optional": true,
                        "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array",
                        "display": true
                    },
                    {
                        "label": "Enable Memory",
                        "name": "agentEnableMemory",
                        "type": "boolean",
                        "description": "Enable memory for the conversation thread",
                        "default": true,
                        "optional": true,
                        "id": "agentAgentflow_0-input-agentEnableMemory-boolean",
                        "display": true
                    },
                    {
                        "label": "Memory Type",
                        "name": "agentMemoryType",
                        "type": "options",
                        "options": [
                            {
                                "label": "All Messages",
                                "name": "allMessages",
                                "description": "Retrieve all messages from the conversation"
                            },
                            {
                                "label": "Window Size",
                                "name": "windowSize",
                                "description": "Uses a fixed window size to surface the last N messages"
                            },
                            {
                                "label": "Conversation Summary",
                                "name": "conversationSummary",
                                "description": "Summarizes the whole conversation"
                            },
                            {
                                "label": "Conversation Summary Buffer",
                                "name": "conversationSummaryBuffer",
                                "description": "Summarize conversations once token limit is reached. Default to 2000"
                            }
                        ],
                        "optional": true,
                        "default": "allMessages",
                        "show": {
                            "agentEnableMemory": true
                        },
                        "id": "agentAgentflow_0-input-agentMemoryType-options",
                        "display": true
                    },
                    {
                        "label": "Window Size",
                        "name": "agentMemoryWindowSize",
                        "type": "number",
                        "default": "20",
                        "description": "Uses a fixed window size to surface the last N messages",
                        "show": {
                            "agentMemoryType": "windowSize"
                        },
                        "id": "agentAgentflow_0-input-agentMemoryWindowSize-number",
                        "display": false
                    },
                    {
                        "label": "Max Token Limit",
                        "name": "agentMemoryMaxTokenLimit",
                        "type": "number",
                        "default": "2000",
                        "description": "Summarize conversations once token limit is reached. Default to 2000",
                        "show": {
                            "agentMemoryType": "conversationSummaryBuffer"
                        },
                        "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number",
                        "display": false
                    },
                    {
                        "label": "Input Message",
                        "name": "agentUserMessage",
                        "type": "string",
                        "description": "Add an input message as user message at the end of the conversation",
                        "rows": 4,
                        "optional": true,
                        "acceptVariable": true,
                        "show": {
                            "agentEnableMemory": true
                        },
                        "id": "agentAgentflow_0-input-agentUserMessage-string",
                        "display": true
                    },
                    {
                        "label": "Return Response As",
                        "name": "agentReturnResponseAs",
                        "type": "options",
                        "options": [
                            {
                                "label": "User Message",
                                "name": "userMessage"
                            },
                            {
                                "label": "Assistant Message",
                                "name": "assistantMessage"
                            }
                        ],
                        "default": "userMessage",
                        "id": "agentAgentflow_0-input-agentReturnResponseAs-options",
                        "display": true
                    },
                    {
                        "label": "Update Flow State",
                        "name": "agentUpdateState",
                        "description": "Update runtime state during the execution of the workflow",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Key",
                                "name": "key",
                                "type": "asyncOptions",
                                "loadMethod": "listRuntimeStateKeys",
                                "freeSolo": true
                            },
                            {
                                "label": "Value",
                                "name": "value",
                                "type": "string",
                                "acceptVariable": true,
                                "acceptNodeOutputAsVariable": true
                            }
                        ],
                        "id": "agentAgentflow_0-input-agentUpdateState-array",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "agentModel": "chatOpenAI",
                    "agentMessages": [
                        {
                            "role": "system",
                            "content": "<p>You are a research assistant specializing in financial topics. Given a search term, use web search to retrieve up‑to‑date context and produce a short summary of at most 300 words. Focus on key numbers, events, or quotes that will be useful to a financial analyst.</p>"
                        }
                    ],
                    "agentTools": [
                        {
                            "agentSelectedTool": "googleCustomSearch",
                            "agentSelectedToolConfig": {
                                "agentSelectedTool": "googleCustomSearch"
                            }
                        }
                    ],
                    "agentKnowledgeDocumentStores": "",
                    "agentEnableMemory": true,
                    "agentMemoryType": "allMessages",
                    "agentUserMessage": "<p>Search term: {{$iteration.query}}</p><p>Reason: {{$iteration.reason}}</p>",
                    "agentReturnResponseAs": "userMessage",
                    "agentUpdateState": "",
                    "agentModelConfig": {
                        "cache": "",
                        "modelName": "gpt-4o-mini",
                        "temperature": 0.9,
                        "streaming": true,
                        "maxTokens": "",
                        "topP": "",
                        "frequencyPenalty": "",
                        "presencePenalty": "",
                        "timeout": "",
                        "strictToolCalling": "",
                        "stopSequence": "",
                        "basepath": "",
                        "proxyUrl": "",
                        "baseOptions": "",
                        "allowImageUploads": "",
                        "imageResolution": "low",
                        "reasoningEffort": "medium",
                        "agentModel": "chatOpenAI"
                    }
                },
                "outputAnchors": [
                    {
                        "id": "agentAgentflow_0-output-agentAgentflow",
                        "label": "Agent",
                        "name": "agentAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "agentFlow",
            "parentNode": "iterationAgentflow_0",
            "extent": "parent",
            "width": 168,
            "height": 103,
            "selected": false,
            "positionAbsolute": {
                "x": 190.20987564816664,
                "y": 73.16220840535185
            },
            "dragging": false
        },
        {
            "id": "agentAgentflow_1",
            "position": {
                "x": 461.76351005035474,
                "y": 81.71183989476083
            },
            "data": {
                "id": "agentAgentflow_1",
                "label": "Writer Agent",
                "version": 1,
                "name": "agentAgentflow",
                "type": "Agent",
                "color": "#4DD0E1",
                "baseClasses": ["Agent"],
                "category": "Agent Flows",
                "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning",
                "inputParams": [
                    {
                        "label": "Model",
                        "name": "agentModel",
                        "type": "asyncOptions",
                        "loadMethod": "listModels",
                        "loadConfig": true,
                        "id": "agentAgentflow_1-input-agentModel-asyncOptions",
                        "display": true
                    },
                    {
                        "label": "Messages",
                        "name": "agentMessages",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Role",
                                "name": "role",
                                "type": "options",
                                "options": [
                                    {
                                        "label": "System",
                                        "name": "system"
                                    },
                                    {
                                        "label": "Assistant",
                                        "name": "assistant"
                                    },
                                    {
                                        "label": "Developer",
                                        "name": "developer"
                                    },
                                    {
                                        "label": "User",
                                        "name": "user"
                                    }
                                ]
                            },
                            {
                                "label": "Content",
                                "name": "content",
                                "type": "string",
                                "acceptVariable": true,
                                "generateInstruction": true,
                                "rows": 4
                            }
                        ],
                        "id": "agentAgentflow_1-input-agentMessages-array",
                        "display": true
                    },
                    {
                        "label": "Tools",
                        "name": "agentTools",
                        "type": "array",
                        "optional": true,
                        "array": [
                            {
                                "label": "Tool",
                                "name": "agentSelectedTool",
                                "type": "asyncOptions",
                                "loadMethod": "listTools",
                                "loadConfig": true
                            },
                            {
                                "label": "Require Human Input",
                                "name": "agentSelectedToolRequiresHumanInput",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "id": "agentAgentflow_1-input-agentTools-array",
                        "display": true
                    },
                    {
                        "label": "Knowledge (Document Stores)",
                        "name": "agentKnowledgeDocumentStores",
                        "type": "array",
                        "description": "Give your agent context about different document sources. Document stores must be upserted in advance.",
                        "array": [
                            {
                                "label": "Document Store",
                                "name": "documentStore",
                                "type": "asyncOptions",
                                "loadMethod": "listStores"
                            },
                            {
                                "label": "Describe Knowledge",
                                "name": "docStoreDescription",
                                "type": "string",
                                "generateDocStoreDescription": true,
                                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                                "rows": 4
                            },
                            {
                                "label": "Return Source Documents",
                                "name": "returnSourceDocuments",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "optional": true,
                        "id": "agentAgentflow_1-input-agentKnowledgeDocumentStores-array",
                        "display": true
                    },
                    {
                        "label": "Knowledge (Vector Embeddings)",
                        "name": "agentKnowledgeVSEmbeddings",
                        "type": "array",
                        "description": "Give your agent context about different document sources from existing vector stores and embeddings",
                        "array": [
                            {
                                "label": "Vector Store",
                                "name": "vectorStore",
                                "type": "asyncOptions",
                                "loadMethod": "listVectorStores",
                                "loadConfig": true
                            },
                            {
                                "label": "Embedding Model",
                                "name": "embeddingModel",
                                "type": "asyncOptions",
                                "loadMethod": "listEmbeddings",
                                "loadConfig": true
                            },
                            {
                                "label": "Knowledge Name",
                                "name": "knowledgeName",
                                "type": "string",
                                "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information"
                            },
                            {
                                "label": "Describe Knowledge",
                                "name": "knowledgeDescription",
                                "type": "string",
                                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                                "rows": 4
                            },
                            {
                                "label": "Return Source Documents",
                                "name": "returnSourceDocuments",
                                "type": "boolean",
                                "optional": true
                            }
                        ],
                        "optional": true,
                        "id": "agentAgentflow_1-input-agentKnowledgeVSEmbeddings-array",
                        "display": true
                    },
                    {
                        "label": "Enable Memory",
                        "name": "agentEnableMemory",
                        "type": "boolean",
                        "description": "Enable memory for the conversation thread",
                        "default": true,
                        "optional": true,
                        "id": "agentAgentflow_1-input-agentEnableMemory-boolean",
                        "display": true
                    },
                    {
                        "label": "Memory Type",
                        "name": "agentMemoryType",
                        "type": "options",
                        "options": [
                            {
                                "label": "All Messages",
                                "name": "allMessages",
                                "description": "Retrieve all messages from the conversation"
                            },
                            {
                                "label": "Window Size",
                                "name": "windowSize",
                                "description": "Uses a fixed window size to surface the last N messages"
                            },
                            {
                                "label": "Conversation Summary",
                                "name": "conversationSummary",
                                "description": "Summarizes the whole conversation"
                            },
                            {
                                "label": "Conversation Summary Buffer",
                                "name": "conversationSummaryBuffer",
                                "description": "Summarize conversations once token limit is reached. Default to 2000"
                            }
                        ],
                        "optional": true,
                        "default": "allMessages",
                        "show": {
                            "agentEnableMemory": true
                        },
                        "id": "agentAgentflow_1-input-agentMemoryType-options",
                        "display": true
                    },
                    {
                        "label": "Window Size",
                        "name": "agentMemoryWindowSize",
                        "type": "number",
                        "default": "20",
                        "description": "Uses a fixed window size to surface the last N messages",
                        "show": {
                            "agentMemoryType": "windowSize"
                        },
                        "id": "agentAgentflow_1-input-agentMemoryWindowSize-number",
                        "display": false
                    },
                    {
                        "label": "Max Token Limit",
                        "name": "agentMemoryMaxTokenLimit",
                        "type": "number",
                        "default": "2000",
                        "description": "Summarize conversations once token limit is reached. Default to 2000",
                        "show": {
                            "agentMemoryType": "conversationSummaryBuffer"
                        },
                        "id": "agentAgentflow_1-input-agentMemoryMaxTokenLimit-number",
                        "display": false
                    },
                    {
                        "label": "Input Message",
                        "name": "agentUserMessage",
                        "type": "string",
                        "description": "Add an input message as user message at the end of the conversation",
                        "rows": 4,
                        "optional": true,
                        "acceptVariable": true,
                        "show": {
                            "agentEnableMemory": true
                        },
                        "id": "agentAgentflow_1-input-agentUserMessage-string",
                        "display": true
                    },
                    {
                        "label": "Return Response As",
                        "name": "agentReturnResponseAs",
                        "type": "options",
                        "options": [
                            {
                                "label": "User Message",
                                "name": "userMessage"
                            },
                            {
                                "label": "Assistant Message",
                                "name": "assistantMessage"
                            }
                        ],
                        "default": "userMessage",
                        "id": "agentAgentflow_1-input-agentReturnResponseAs-options",
                        "display": true
                    },
                    {
                        "label": "Update Flow State",
                        "name": "agentUpdateState",
                        "description": "Update runtime state during the execution of the workflow",
                        "type": "array",
                        "optional": true,
                        "acceptVariable": true,
                        "array": [
                            {
                                "label": "Key",
                                "name": "key",
                                "type": "asyncOptions",
                                "loadMethod": "listRuntimeStateKeys",
                                "freeSolo": true
                            },
                            {
                                "label": "Value",
                                "name": "value",
                                "type": "string",
                                "acceptVariable": true,
                                "acceptNodeOutputAsVariable": true
                            }
                        ],
                        "id": "agentAgentflow_1-input-agentUpdateState-array",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "agentModel": "chatOpenAI",
                    "agentMessages": [
                        {
                            "role": "system",
                            "content": "<p>You are a senior financial analyst. You will be provided with the original query and a set of raw search summaries. Your task is to synthesize these into a long‑form markdown report (at least several paragraphs) including a short executive summary and follow‑up questions</p>"
                        }
                    ],
                    "agentTools": "",
                    "agentKnowledgeDocumentStores": "",
                    "agentEnableMemory": true,
                    "agentMemoryType": "allMessages",
                    "agentUserMessage": "<p>Original query: <span class=\"variable\" data-type=\"mention\" data-id=\"$form.query\" data-label=\"$form.query\">{{ $form.query }}</span></p><p>Summarized search results: <span class=\"variable\" data-type=\"mention\" data-id=\"iterationAgentflow_0\" data-label=\"iterationAgentflow_0\">{{ iterationAgentflow_0 }}</span></p>",
                    "agentReturnResponseAs": "userMessage",
                    "agentUpdateState": "",
                    "agentModelConfig": {
                        "cache": "",
                        "modelName": "gpt-4o-mini",
                        "temperature": 0.9,
                        "streaming": true,
                        "maxTokens": "",
                        "topP": "",
                        "frequencyPenalty": "",
                        "presencePenalty": "",
                        "timeout": "",
                        "strictToolCalling": "",
                        "stopSequence": "",
                        "basepath": "",
                        "proxyUrl": "",
                        "baseOptions": "",
                        "allowImageUploads": "",
                        "imageResolution": "low",
                        "reasoningEffort": "medium",
                        "agentModel": "chatOpenAI"
                    }
                },
                "outputAnchors": [
                    {
                        "id": "agentAgentflow_1-output-agentAgentflow",
                        "label": "Agent",
                        "name": "agentAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "agentFlow",
            "width": 168,
            "height": 71,
            "selected": false,
            "positionAbsolute": {
                "x": 461.76351005035474,
                "y": 81.71183989476083
            },
            "dragging": false
        },
        {
            "id": "stickyNoteAgentflow_0",
            "position": {
                "x": 214.77714507955716,
                "y": -165.2444952661696
            },
            "data": {
                "id": "stickyNoteAgentflow_0",
                "label": "Sticky Note",
                "version": 1,
                "name": "stickyNoteAgentflow",
                "type": "StickyNote",
                "color": "#fee440",
                "baseClasses": ["StickyNote"],
                "category": "Agent Flows",
                "description": "Add notes to the agent flow",
                "inputParams": [
                    {
                        "label": "",
                        "name": "note",
                        "type": "string",
                        "rows": 1,
                        "placeholder": "Type something here",
                        "optional": true,
                        "id": "stickyNoteAgentflow_0-input-note-string",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "note": "Search Agent will iterate through the search terms and search the web using tool"
                },
                "outputAnchors": [
                    {
                        "id": "stickyNoteAgentflow_0-output-stickyNoteAgentflow",
                        "label": "Sticky Note",
                        "name": "stickyNoteAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "stickyNote",
            "width": 189,
            "height": 142,
            "selected": false,
            "positionAbsolute": {
                "x": 214.77714507955716,
                "y": -165.2444952661696
            },
            "dragging": false
        },
        {
            "id": "stickyNoteAgentflow_1",
            "position": {
                "x": -100.05436009717414,
                "y": -45.56902388417101
            },
            "data": {
                "id": "stickyNoteAgentflow_1",
                "label": "Sticky Note (1)",
                "version": 1,
                "name": "stickyNoteAgentflow",
                "type": "StickyNote",
                "color": "#fee440",
                "baseClasses": ["StickyNote"],
                "category": "Agent Flows",
                "description": "Add notes to the agent flow",
                "inputParams": [
                    {
                        "label": "",
                        "name": "note",
                        "type": "string",
                        "rows": 1,
                        "placeholder": "Type something here",
                        "optional": true,
                        "id": "stickyNoteAgentflow_1-input-note-string",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "note": "Planner will generate list of search terms to query for"
                },
                "outputAnchors": [
                    {
                        "id": "stickyNoteAgentflow_1-output-stickyNoteAgentflow",
                        "label": "Sticky Note",
                        "name": "stickyNoteAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "stickyNote",
            "width": 189,
            "height": 101,
            "selected": false,
            "positionAbsolute": {
                "x": -100.05436009717414,
                "y": -45.56902388417101
            },
            "dragging": false
        },
        {
            "id": "stickyNoteAgentflow_2",
            "position": {
                "x": 457.98399139175314,
                "y": -35.19227767879839
            },
            "data": {
                "id": "stickyNoteAgentflow_2",
                "label": "Sticky Note (2)",
                "version": 1,
                "name": "stickyNoteAgentflow",
                "type": "StickyNote",
                "color": "#fee440",
                "baseClasses": ["StickyNote"],
                "category": "Agent Flows",
                "description": "Add notes to the agent flow",
                "inputParams": [
                    {
                        "label": "",
                        "name": "note",
                        "type": "string",
                        "rows": 1,
                        "placeholder": "Type something here",
                        "optional": true,
                        "id": "stickyNoteAgentflow_2-input-note-string",
                        "display": true
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "note": "Generate the final report from the search results"
                },
                "outputAnchors": [
                    {
                        "id": "stickyNoteAgentflow_2-output-stickyNoteAgentflow",
                        "label": "Sticky Note",
                        "name": "stickyNoteAgentflow"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "type": "stickyNote",
            "width": 189,
            "height": 101,
            "selected": false,
            "positionAbsolute": {
                "x": 457.98399139175314,
                "y": -35.19227767879839
            },
            "dragging": false
        }
    ],
    "edges": [
        {
            "source": "startAgentflow_0",
            "sourceHandle": "startAgentflow_0-output-startAgentflow",
            "target": "llmAgentflow_0",
            "targetHandle": "llmAgentflow_0",
            "data": {
                "sourceColor": "#7EE787",
                "targetColor": "#64B5F6",
                "isHumanInput": false
            },
            "type": "agentFlow",
            "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0"
        },
        {
            "source": "llmAgentflow_0",
            "sourceHandle": "llmAgentflow_0-output-llmAgentflow",
            "target": "iterationAgentflow_0",
            "targetHandle": "iterationAgentflow_0",
            "data": {
                "sourceColor": "#64B5F6",
                "targetColor": "#9C89B8",
                "isHumanInput": false
            },
            "type": "agentFlow",
            "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-iterationAgentflow_0-iterationAgentflow_0"
        },
        {
            "source": "iterationAgentflow_0",
            "sourceHandle": "iterationAgentflow_0-output-iterationAgentflow",
            "target": "agentAgentflow_1",
            "targetHandle": "agentAgentflow_1",
            "data": {
                "sourceColor": "#9C89B8",
                "targetColor": "#4DD0E1",
                "isHumanInput": false
            },
            "type": "agentFlow",
            "id": "iterationAgentflow_0-iterationAgentflow_0-output-iterationAgentflow-agentAgentflow_1-agentAgentflow_1"
        }
    ]
}
